﻿using DevExpress.Utils;
using EyFramework.Common;
using EyFramework.Library;
using Ncov2019.Core.Service;
using Ncov2019.Entity;
using System;
using DevExpress.Utils;
using EyFramework.Common;
using EyFramework.Library;
using Ncov2019.Core.Service;
using Ncov2019.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using EyFramework.Sys.Core;

namespace Ncov2019
{
    public partial class Frmfareshouzhen : FrmDevBase
    {

        private List<GridColumnInfo> ColumnInfos = new List<GridColumnInfo>();
        private IZjJiuzhenxxService zjJiuzhenxxService;
        public Frmfareshouzhen()
        {
            InitializeComponent();
        }
        private void InitForm()
        {
            gvData.ShowRowNum();
            gcData.ShowContextMenu(this.components);//显示右键导出功能
            #region
            ColumnInfos.Add(new GridColumnInfo("BINGRENID", "病历号码", 100));
            ColumnInfos.Add(new GridColumnInfo("XINGMING", "姓名", 100));
            ColumnInfos.Add(new GridColumnInfo("XINGBIE", "性别", 100));
            ColumnInfos.Add(new GridColumnInfo("OLD", "年龄", 100));
            ColumnInfos.Add(new GridColumnInfo("JIATINGDZ", "联系地址", 100));
            ColumnInfos.Add(new GridColumnInfo("JIATINGDH", "联系电话", 100));
            ColumnInfos.Add(new GridColumnInfo("KESHIMC", "就诊科室", 100));
            ColumnInfos.Add(new GridColumnInfo("ZHIGONGXM", "就诊医生", 100));
            ColumnInfos.Add(new GridColumnInfo("BINGRENQX", "病人去向", 100));
            ColumnInfos.Add(new GridColumnInfo("SZBZ", "首诊标记", 100));
            #endregion
        }

        private void btnQuery_Click(object sender, EventArgs e)
        {
            ShowLoading();
            try
            {
                QueryData();
            }
            finally
            {
                CloseLoading();
            }
        }

        private void QueryData()
        {
            var Shouzhen = zjJiuzhenxxService.QueryByShouzhenjl(de_start.Text,de_start.Text);
            gcData.DataSource = Shouzhen;
            DevPublic.SetGridControlView(gvData, ColumnInfos, true, true);
        }
        private void FrmNcov_Load(object sender, EventArgs e)
        {
            zjJiuzhenxxService = Globals.GetService<IZjJiuzhenxxService>();
            InitForm();
            de_start.Text = DateTime.Now.ToString("yyyy-MM")+"-01";
            de_end.Text = DateTime.Now.ToString("yyyy-MM-dd");
        }
    }
}
